package com.baichang.taoshunda.service;

import com.baichang.framework.excelption.ServiceException;
import com.baichang.taoshunda.job.AddCompanyMoneyJob;
import org.quartz.JobKey;

/**
 * Created by Administrator on 2018/7/7 0007.
 */
public interface TwoSchedulerService {
    /**
     * 启动定时任务
     */
    void start();

    /**
     * 关闭定时任务
     */
    void close();

    /**
     * 删除全部任务
     *
     * @return
     * @throws ServiceException
     */
    boolean deleteAllJob() throws ServiceException;

    /**
     * 删除任务
     *
     * @param jobKey
     * @return
     * @throws ServiceException
     */
    boolean deleteJob(JobKey jobKey) throws ServiceException;


    /**
     * @param timing
     * @param agentMonthMoneyClass
     * @param agentId
     */
    JobKey addSchedulerByCron(String timing, Class<AddCompanyMoneyJob> agentMonthMoneyClass, String agentId) throws ServiceException;
}
